import 'package:flutter_test/flutter_test.dart';
import 'package:wallpaper_client_plugin/wallpaper_client_plugin.dart';
import 'package:wallpaper_client_plugin/wallpaper_client_plugin_platform_interface.dart';
import 'package:wallpaper_client_plugin/wallpaper_client_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockWallpaperClientPluginPlatform
    with MockPlatformInterfaceMixin
    implements WallpaperClientPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  void downloadWallpaper(Map catelogItem) {
    // TODO: implement downloadWallpaper
  }

  @override
  Future<bool?> sensorsAvailable() {
    // TODO: implement sensorsAvailable
    throw UnimplementedError();
  }

  @override
  void setWallpaper(Map catelogItem) {
    // TODO: implement setWallpaper
  }
}

void main() {
  final WallpaperClientPluginPlatform initialPlatform = WallpaperClientPluginPlatform.instance;

  test('$MethodChannelWallpaperClientPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelWallpaperClientPlugin>());
  });

  test('getPlatformVersion', () async {
    WallpaperClientPlugin wallpaperClientPlugin = WallpaperClientPlugin();
    MockWallpaperClientPluginPlatform fakePlatform = MockWallpaperClientPluginPlatform();
    WallpaperClientPluginPlatform.instance = fakePlatform;

    expect(await wallpaperClientPlugin.getPlatformVersion(), '42');
  });
}
